<template>
	<div id="templ">
		<div v-for = "item in list">
			<h4>{{item.title}}</h4>
			<p class="time">{{item.add_time | datefmt("YYYY-MM-DD")}}  &nbsp; {{item.click}}次浏览</p>
			<div v-html = "item.content" class="content"></div>
		</div>
		<comment :id1="id"></comment>
	</div>
	
	
</template>


<script>
	import comment from "../subcom/comment.vue"
	export default {
		data:function(){
			return{
				id:"",
				list:[]
			}
		},
		methods:{
			getid:function(){
				this.id = this.$route.params.id;
			}
		},
		created:function(){
			this.getid();
			var url = this.$common.apidomain+"/api/getnew/"+this.id;
			this.$http.get(url).then(function(res){
				if(res.body.status !=0) {
						this.Toast(res.body.message);
						return;
					}

				this.list = res.body.message;
			})
		},
		components:{
			comment
		}

	}


</script>



<style scoped>
	h4 {
		color: #0094ff;
	}
	.time {
		color: rgba(0,0,0,.5);
	}
	.content {
		padding: 5px;
	}
</style>